package L622;

/**
 * @program: javase
 * @description: 旋转数组最小值
 * @author: luolidong
 * @create: 2021-06-22 18:47
 * @version: 1.0
 */
public class Demo1 {
    // 4 5 6 1 2 3
    public int minArray(int[] numbers) {
        int l=0,r=numbers.length-1;
        while (l<r){
            int mid=(l+r)/2;
            if(numbers[mid]>numbers[r]){
                l=mid+1;
            }else {
                r=mid;
            }
        }
        return numbers[l];
    }

    public static void main(String[] args) {
        int i = new Demo1().minArray(new int[]{3,3,3,3,1,3,3});
        System.out.println(i);
    }
}
